<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
</head>
<body>
    <div id="app" v-cloak>
        数值A：<input type="text" v-model='a'>
        数值B：<input type="text" v-model='b'>
        <button @click='sum'>计算</button>
        <br>
        计算结果：{{result}}
    </div>
    <script src="../node_modules/vue/dist/vue.min.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data: {
               a:'',
               b:'',
               result:''
            },
            methods: {
                sum:function(){
                    this.result = parseInt(this.a) + parseInt(this.b)
                }
            },
        })
    </script>
</body>
</html>